#include <iostream>

using namespace std;

class Solution
{
public:
    int brokenCalc(int startValue, int target)
    {
        return rs(target, startValue);
    }

    int rs(int start, int target)
    {
        if (start <= target)
            return target - start;
        if (start % 2==0)
            return rs(start / 2, target) + 1;
        else
            return rs(start / 2 + 1, target) + 2;
    };
};

int main()
{
    cout << "Code991" << endl;
    Solution s;
    cout << s.brokenCalc(3, 10) << endl;
    return 0;
}